package com.mo.dao;


import com.mo.pojo.SysUser;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


import java.util.List;


@Mapper
public interface SysUserDao {


    List<SysUser> selectUser(SysUser user);

    @Delete("delete from user where uCode=#{uCode}")
    int deleteByuCode(Long uCode);

    @Select("select *from user where uCode=#{uCode}")  //简单sql直接在方法
    SysUser findByuCode(long uCode);


    int insertUser(SysUser user);


    int updateUser(SysUser user);


    @Select("select * from user where uName=#{uName}")
    SysUser selectUserByuName(String uName);


    @Update("update user set upwd=#{uPwd}," +
             "where ucode=#{ucode}")
    int updatePassword(
            String newPassword,
            Integer userId);

}
